<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class DbConnection {
    
    // Store the single instance of Database 
    private static $instance; 
    public $conn;

    private function __construct() { 
        $this->conn = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME, DB_USER, DB_PASSWORD);
        $this->conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
    } 

    public static function getInstance(){ 
        if (!self::$instance) { 
            self::$instance = new DbConnection(); 
        } 

        return self::$instance; 
    } 
    
}